package Thread;

import java.io.File;

/**
 * 进度条更新类
 * @author 张雨
 *
 */
public class RateThread extends Thread{
	private File[] part;
	
	RateThread(long fileLength,File[] part){	
		this.part=part;
		DownloadPane.f.setMinimum(0);
		DownloadPane.f.setMaximum((int)fileLength);
	}
	
	public void run() {  
		int count = 0;
		while(UndoneDownloadThread.undoneThreadNum!=0){
			count=0;
			for(int i=0;i<part.length;i++){
				count+=part[i].length();
			}
			DownloadPane.f.setValue(count);
		}
	}
	
		
}
